package com.fate.config;

import com.alipay.demo.trade.config.Configs;
import com.alipay.demo.trade.service.AlipayTradeService;
import com.alipay.demo.trade.service.impl.AlipayTradeServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;


@Configuration
public class AliPayAutoConfiguration {

    @Autowired
    private AliProperties aliProperties;

    private AliPayAutoConfiguration(){
        //初始化ali的配置文件
        Configs.init("zfbinfo.properties");
    }

    /**
     * 创建支付客户端 放入容器中
     *
     * @return
     */
    @Bean
    public AlipayTradeService alipayTradeService() {
        return new AlipayTradeServiceImpl.ClientBuilder().build();
    }


}
